<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../node_modules/axios/dist/axios.js"></script>
</head>
<body>
<button>发送请求1</button>
<button>发送请求2</button>
</body>
<script>
    const btns = document.querySelectorAll("button");
    axios.defaults.baseURL = "http://zhangpeiyue.com";
    axios.defaults.timeout = 2000;
    axios.defaults.headers.a = 1;
    axios.defaults.params={
        b:2
    }
    btns[0].onclick = function () {
        axios.get("/scoreList").then(value=>{
            console.log(value.data);
        })
    }
    btns[1].onclick = function () {
        axios.get("http://127.0.0.1/scoreList",{
            params:{
                sex:"男"
            }
        }).then(value=>{
            console.log(value.data);
        })
    }
</script>
</html>